
let ul = document.querySelector('#list')
let el = "";
fetch('http://chst.vip:1234/api/getmoneyctrl')
.then(body => body.json())
.then(res => {
    console.log(res)
    res.result.forEach(item => {
        let regExp = /(?<=imgurl=)[^'"]*/;
        let r = item.productImg2.match(regExp);
        el += `<li productid=${item.productId}>
        <img src=${r[0]} height="100" alt="">
        <b>${item.productName}</b>
    </li>`
    })
    ul.innerHTML = el;
    ul.onclick=function(e){
        if(e.target.localName=="li"){
            let _this = e.target;
            console.log(_this)
            let id =_this.getAttribute('productid')
            location.href='discount.html?productid='+ id
        }
    }
})

$('#nav').find('.navMore').click(function(){
    $('#nav').find('.navBtm').finish().slideToggle(200)
})
